<!--

/*
* Copyright (C) 2005-2013 University of Sydney
*
* Licensed under the GNU License, Version 3.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.gnu.org/licenses/gpl-3.0.txt
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/

/**
* Original Map with Timeline
*
* @author      Kim Jackson
* @author      Stephen White   <stephen.white@sydney.edu.au>
* @author      Artem Osmakov   <artem.osmakov@sydney.edu.au>
* @copyright   (C) 2005-2013 University of Sydney
* @link        http://Sydney.edu.au/Heurist
* @version     3.1.0
* @license     http://www.gnu.org/licenses/gpl-3.0.txt GNU License 3.0
* @package     Heurist academic knowledge management system
* @subpackage  Viewers/Map
*/

-->

<html>
 <head>
  <link rel=stylesheet href="../../common/css/heurist.css">
  <title>Heurist Resource Database - Map and Timeline</title>

  <style>
#all-table { width: 100%; height: 100%; }

#map, #timeline { width: 100%; height: 100%; }
#timeline-cell { height: 200px; }
#info-cell { height: 2em; padding: 0 1ex; }

#timeline-cell * { font-size: 11px; }

#resizer, #resizer div { font-size: 4px; line-height: 4px; overflow: hidden; height: 4px; background-color: white; cursor: n-resize; display: none; }

body div { line-height: 1.5em; }

  </style>
  <!--<script src="http://simile.mit.edu/timeline/api/timeline-api.js"></script> -->
  <script src="../../external/simile/timeline-api.js" type="text/javascript"></script>

 </head>

 <body style="margin: 0; padding: 0;">

  <table border=0 cellspacing=0 cellpadding=0 id=all-table><tbody>
   <tr><td id=map-cell><div id=map></div></td></tr>
   <tr style="height: 10px;"><td id=resizer><div>&nbsp;</div></td></tr>
   <tr><td id=timeline-cell><div id=timeline></div></td></tr>
   <tr><td id=info-cell>
    <div id=info>
     <label for=filter><input type=checkbox id=filter onclick="timeChange()"> Filter to timebar span</label>
     #Records: <span id=record-count></span> / <span id=total-record-count></span>
    </div>
   </td></tr>
  </tbody></table>

  <script>
if (location.search.match(/\btimeline=0\b/)) {
	document.getElementById("timeline-cell").style.display = "none";
	document.getElementById("info-cell").style.display = "none";
}
var HEURIST = {};
document.write('<scr'+'ipt src="getTMapDataFromQueryResults.php' + location.search + '"></scr'+'ipt>');
</script>

<script>
if (HEURIST.tmap.totalRecordCount == 0) {
	document.body.style.margin = "10px";
	document.body.innerHTML = "<h3>The search results you are trying to plot do not contain any geographic objects</h3>";
	if (window.stop) window.stop();
	else if (document.execCommand) document.execCommand("Stop");
}
else {
	document.getElementById("record-count").innerHTML = "" + HEURIST.tmap.totalRecordCount;
	document.getElementById("total-record-count").innerHTML = "" + HEURIST.tmap.totalRecordCount;
}
  </script>

  <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAGZugEZOePOFa_Kc5QZ0UQRQUeYPJPN0iHdI_mpOIQDTyJGt-ARSOyMjfz0UjulQTRjpuNpjk72vQ3w"></script>
  <script src='http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1'></script>
  <script src="http://api.maps.yahoo.com/ajaxymap?v=3.0&amp;appid=euzuro-openlayers"></script>

  <script src="http://openlayers.org/dev/OpenLayers.js"></script>

  <script src="loadOLMap.js"></script>

  <script src="loadTimeline.js"></script>

  <script>
if (HEURIST.tmap.totalRecordCount > 0) {
	loadMap({ compact: location.search.match(/\bcompact=1\b/) });
	if (! location.search.match(/\btimeline=0\b/)) loadTimeline();
}

var resizerCell = document.getElementById("resizer");
var timelineCell = document.getElementById("timeline-cell");
resizerCell.onmousedown = function(e) {
	if (! e) e = window.event;

	var downY = e.pageY || e.clientY;
	var downHeight = timelineCell.offsetHeight;

	resizerCell.document_mouseup = function(e) {
		if (! e) e = window.event;

		var upY = e.pageY || e.clientY;
		var upHeight = downHeight + (downY - upY);

		timelineCell.style.height = upHeight + "px";

		top.HEURIST.deregisterEvent(document, "mouseup", resizerCell.document_mouseup);
	};

	top.HEURIST.registerEvent(document, "mouseup", resizerCell.document_mouseup);
};
  </script>

 </body>
</html>
